package com.eloisa.gls.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eloisa.gls.dao.ITestDao;
import com.eloisa.gls.domain.Test;
@Service
public class TestService implements ITestService{
	@Autowired
	private ITestDao testDao;
	
	
	public Test getTest(Integer id) {
		Test test = testDao.findById(id);
		return test;
	}


	public void createTest(Test test) {
		testDao.create(test);
	}


	public void updateTest(Test test) {
		Test old = getTest(test.getId());
		old.setContent(test.getContent());
		old.setMyKey(test.getMyKey());
		testDao.update(old);
	}


	public void deleteTest(Integer id) {
		Test old = getTest(id);
		testDao.delete(old);
	}
	
	

}
